from pydantic import BaseModel
from typing import Optional
from datetime import datetime

class MedicalTermBase(BaseModel):
    term_chinese: str
    term_lisu: str
    term_vietnamese: Optional[str] = None
    term_laowu: Optional[str] = None
    term_miandian: Optional[str] = None

class MedicalTermCreate(MedicalTermBase):
    pass

class MedicalTermUpdate(MedicalTermBase):
    term_chinese: Optional[str] = None
    term_lisu: Optional[str] = None

class MedicalTermOut(MedicalTermBase):
    id: int
    created_at: Optional[datetime] = None
    updated_at: Optional[datetime] = None

    class Config:
        from_attributes = True